package com.example.demo.design.creational.abstractfactory;

import com.example.demo.design.creational.factorymethod.AbstractFactory;
import com.example.demo.design.creational.factorymethod.ConcreteFactory1;
import com.example.demo.design.creational.factorymethod.Product;

/**
 * 抽象工厂
 *
 * @author luowj12
 * @since 2021/5/6 16:23
 */
public class AbstractFactoryTest {

    public static void main(String[] args) {
        try {
            Farm f;
            Animal a;
            Plant p;
            f = (Farm) new SRfarm();
            a = f.newAnimal();
            p = f.newPlant();
            a.show();
            p.show();
        } catch (Exception e) {
            System.out.println(e.getMessage());
        }
    }
}
